//==============================================================================
// LocalSTL.hh
// ---------------------------------------------------------------------------
// Includes the system-specific implementation of STL, the Standard Template 
// Library, and the C++ standard libraries.  These tend to be handled slightly 
// differently depending on the platform.  
//
// STL is a late coming feature to C++, and only very very recently made it into 
// the C++ standard.  So there are slight implementation differences between compilers.  
// The compilers we use at the HGSC are:
// 
// Forte   (for 64-bit clean compilation to run on > 4GB Solaris). 
// gcc2    (standard compiler installed on Solaris/Linux). 
// gcc3    (standard compiler on OSX, and soon to be on Solaris/Linux). 
//
// Forte and gcc2/gcc3 each have their own version of STL included. 
// Sometimes I want to debug something in STL itself.  For that I 
// want to run SafeSTL, which is available in STLPort, a cross-platform 
// STL.  SafeSTL does bounds checking on every access, which slows 
// things down, but makes it easy to detect certain kinds of errors. 
// 
// So the compiler can be Forte, gcc2, or gcc3, and the STL version can 
// be the built-in version or STLPort.   
// 
// Eventually we will be adding the Intel compiler into the mix.  
// 
//
//-----------------------------------------------------------------------------
// $Id:$
//-----------------------------------------------------------------------------
// $Log:$
//
//==============================================================================
//.......1.........2.........3.........4.........5.........6.........7.........8
//

#ifndef _LOCAL_STL
#define _LOCAL_STL

// In the old days, computers were slow, and it was ill advised to include headers 
// you don't need because the compiler has to process them all and that takes time
// (and in the very old days RAM was an issue too).   Now, I find that I'd rather 
// take the compile speed hit than try to figure out just which headers I need, so 
// I just include everything  I ever use all at once.

// These are the bits that seem to be stable across our various compilers
#include <vector>
#include <string>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <fstream>
#include <string>
#include <string.h>
#include <math.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>

// gcc2 isn't picky about this, but gcc3 is.  
using namespace std;

// ----------------------------------------------------
// * Forte64 Compiler (64-bit clean Solaris) 
// ----------------------------------------------------
#ifdef FORTE64

#include <hash_map>
#include <hash_set>
#include <strstream.h>

typedef ifstream izipstream;
typedef ofstream ozipstream; 

#endif 

// ----------------------------------------------------
// * GCC2 or GCC3
// ----------------------------------------------------
#ifdef GCC3

// ----------------------------------------------------
// * GCC3
// ----------------------------------------------------

// For some reason, they've moved hash_map into __gnu_cxx.  
// I'm cool with hash_map going somewhere other than std:: 
// since, after all, it's not part of the standard.  But why 
// did they pick such an ugly namespace name?  

// I see that setting the namespace and including algobase.h 
// is done by <backward/hash_map.h>.  Perhaps I should be 
// including it that way.  Not sure...   I sure hope hash_map isn't 
// on the way out, though, because I use it all the time. 
//
// Itanium seems to be like GCC3, but without this 
// Well, unless you are using the gcc compatibility mode, which I am...
//#ifndef ICC
using namespace __gnu_cxx;
//#endif 

// As of GCC 3.0, hash_map and hash_set have been moved to an ext 
// sub directory.  Also, there is backward/hash_map.h.  I'm not 
// sure which is the preferred way to include these. 
// 
#include <ext/hash_map>
#include <ext/hash_set>

// In 3.3 strstream has been deprecated, for some reason. It's still in 
// backward compatibility directory. 
#include <sstream>

// For some reason, Table.hh complains when this is missing. 
//#include <backward/strstream>

// I've switched from using zipiostream to gzstream. 
// This maps the names so all the source doesn't have to 
// be changed.
#include "gzstream.h"
typedef igzstream izipstream;
typedef ogzstream ozipstream;

#endif

// ----------------------------------------------------
// * ICC
// ----------------------------------------------------
// Intel is very close to GCC3.  Closer still if we compile
// with icc using the gcc compatibility flag and the gcc 
// headers. 
#ifdef ICC 

// This is great for GCC compatibility mode, but that doesn't 
// give us 64-bit. 
// using namespace __gnu_cxx;

#include <ext/hash_map>
#include <ext/hash_set>

// STL Port version. 
//typedef ifstream izipstream;
//typedef ofstream ozipstream; 
//#include <hash_map>
//#include <hash_set>

//#include <strstream.h>
#include <sstream>

//typedef ifstream izipstream;
//typedef ofstream ozipstream; 

#include "gzstream.h"
typedef igzstream izipstream;
typedef ogzstream ozipstream;
#endif 


// ----------------------------------------------------
// * GCC2
// ----------------------------------------------------
#ifdef GCC2 
#include <hash_map>
#include <hash_set>

#include <strstream.h>
#include <sstream>

// I've switched from using zipiostream to gzstream. 
// This maps the names so all the source doesn't have to 
// be changed.
#include "gzstream.h"
typedef igzstream izipstream;
typedef ogzstream ozipstream;

#endif // else not GCC3


#endif 
















